import 'package:flutter/material.dart';

class PrimaryLabel extends StatelessWidget {
  final String text;
  final Widget trailing;
  final Color bgColor;

  const PrimaryLabel(this.text, {Key key, this.trailing, this.bgColor})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    List<Widget> children = [
      Row(
        children: [
          Container(
            width: 3,
            height: 20,
            color: Color(0xff13d8a0),
          ),
          SizedBox(width: 10),
          Text(
            text,
            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
          ),
        ],
      )
    ];
    if (trailing != null) {
      children.add(trailing);
    }
    return Container(
      height: 60,
      color: bgColor ?? Colors.white,
      padding: EdgeInsets.symmetric(horizontal: 20),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: children,
      ),
      alignment: Alignment.centerLeft,
    );
  }
}
